package view;

import java.io.IOException;

import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

import controller.CelularSystem;

public class TelaAlarme extends Canvas
{
	Font fonte;
	Image icone;
	
	public TelaAlarme()
	{
		this.fonte = Font.getFont(Font.FACE_PROPORTIONAL,Font.STYLE_BOLD,Font.SIZE_LARGE);
		
		try
		{
			this.icone = Image.createImage("/alarm.png");
			
		} catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	protected void paint(Graphics g)
	{
		
		g.setColor(255,0,0);
		g.fillRect(0,0,getWidth(),getHeight());

		g.setFont(this.fonte);
		g.setColor(255,255,255);
		g.drawString(CelularSystem.NOME_APLICACAO,( (getWidth()/2) - this.fonte.stringWidth(CelularSystem.NOME_APLICACAO)/2 ), getHeight()/10,Graphics.TOP | Graphics.LEFT);
		
		g.drawImage(this.icone,getWidth()/2 - icone.getWidth()/2, (int)(getHeight() * 0.5) - icone.getHeight()/2,Graphics.TOP | Graphics.LEFT);
		
		g.drawString(CelularSystem.MENSAGEM_ROUBO, (getWidth()/2) - (this.fonte.stringWidth(CelularSystem.MENSAGEM_ROUBO)/2) , (int)(getHeight() * 0.7),Graphics.TOP | Graphics.LEFT);
		
		
	}

}
